<template>
    <div class="list_content_item_fold">
        <div class="list_content_item_fold_title">
            <div>
                <label>产品信息</label>
                <span>仅显示有效险种</span>
            </div>
            <slot name="right"> </slot>
        </div>
        <div class="list_content_item_fold_listItem_box">
            <!-- <div class="list_content_item_fold_listItem" v-show="product.openOrClose == 'open'" v-for="item in product.productList" :key="item.productNo">
                <div class="list_item_item">
                    <img v-if="!item.additional " src="../../assets/img/mergeH5/main.png" alt="">
                    <img v-else src="../../assets/img/mergeH5/attach.png" alt="">
                    <div>
                        <label>{{ item.productName }}</label>
                        <span v-if="item.clauseAnalysis == '1'">*</span>
                    </div>
                </div>
                <div class="list_item_bzq">保障期限：{{ item.commencementTime }} 至 {{ item.terminationTime }}</div>   
            </div>  -->
            <div class="container list_content_item_fold_listItem" v-show="product.openOrClose == 'open'" >
                <div class="item" v-for="item in product.productList" :key="item.productNo">
                    <div class="list_item_item">
                    <img v-if="!item.additional " src="../../assets/img/mergeH5/main.png" alt="">
                    <img v-else src="../../assets/img/mergeH5/attach.png" alt="">
                    <div>
                        <label>{{ item.productName }}</label>
                        <!-- 因接口调用关系，目前clauseAnalysis为默认值全部为1，显示没有意义，暂时注释掉 -->
                        <!-- <span v-if="item.clauseAnalysis == '1'">*</span> -->
                    </div>
                </div>
                <div class="list_item_bzq">保障期限：{{ item.commencementTime }} 至 {{ item.terminationTime }}</div>   
                </div>
             
                <!-- 根据需要添加更多.item元素 -->
            </div>
        </div>

        <slot name="bottom" :policyNo="product.policyNo"></slot>
    </div>
</template>
<script lang="ts" name="listitem">
import main from "/@/assets/img/mergeH5/main.png"
// import attach from "/@/assets/img/mergeH5/attach.png"
export default {
    props: {
        product: {
            type: Object,
            default: function () {
                return {}; // 返回一个空对象作为默认值  
            },
        }
    },
    mounted(){
        // console.log(this.product)
    }
}  
</script>
<style lang="less">
.list_content_item_fold {
    margin-left: 12px;
    margin-right: 12px;
    width: calc(100% - 24px);
    padding: 8px 12px;
    box-sizing: border-box;
    background: url(../../assets/img/mergeH5/item_bg.png) left top no-repeat;
    background-size: 100% 100%;

    .list_content_item_fold_title {
        display: flex;
        justify-content: space-between;
        line-height: 18px;
        font-size: 12px;

        label {
            color: #222;
            font-weight: 500;
            margin-right: 10px;
        }

        span {
            color: #868686;
            font-weight: 400;
        }

        img {
            width: 20px;
            height: 17px;
            padding: 4px;
        }
    }

    .list_content_item_fold_listItem_box {
        width: 100%;

        /* 通用样式 */
        .container {
            display: flex;
            flex-wrap: wrap;
            /* 允许子元素换行 */
            justify-content: flex-start;
            /* 水平对齐方式，可以根据需要调整 */
        }

        .item {
            width: 100%;
            /* 默认占满整行，即一列显示 */
            box-sizing: border-box;
            /* 使得padding和border不会增加元素的总宽度 */
            padding: 10px;
            /* 可选，为项目添加内边距 */
            /* 其他样式 */
        }

        /* 当视口宽度大于或等于某个阈值时，切换到两列布局 */
        @media (min-width: 600px) {
            .item {
                // width: calc(50% - 20px);
                width: calc(50% - 20px);
                /* 减去两倍的padding宽度，避免两列之间重叠 */
                margin: 10px;
                /* 可选，为项目添加外边距以创建间隙 */
            }
        }

        /* 注意：上面的calc计算中的20px是两倍的内边距（左右各10px），你可能需要根据你的具体布局调整这个值 */



        .list_content_item_fold_listItem {
            width: 100%;
            padding: 16px 0px;
            border-bottom: 1px dashed #D5D7D9;
            box-sizing: border-box;

            .list_item_item {
                display: flex;
                align-items: center;
                font-size: 13px;
                font-family: PingFangSC, PingFang SC;

                img {
                    width: 41px;
                    height: 17px;
                    margin-right: 10px;
                }

                label {
                    font-weight: 500;
                    color: #222222;
                    line-height: 21px;
                }

                span {
                    color: rgba(250, 50, 50, 1);
                    font-weight: 600;
                }
            }

            .list_item_bzq {
                margin-top: 8px;
                font-size: 12px;
                font-weight: 400;
                color: #868686;
                line-height: 18px;
                margin-left: 51px;
            }

            &:last-child {
                border: none;
            }
        }
    }

    .detailBtn {
        text-align: right;
        margin-top: 16px;
        margin-left: 80%;

        img {
            // width: 89px;
            height: 24px;
        }

    }
}
</style>
